package cn.tedu._05weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

/*
 1.@NotNull:不允许为null值,message参数表示自定义提示消息
 */
@Data
public class UserRegDTO {

    @ApiModelProperty(value = "昵称",required = true,example = "tony")
    private String nickname;
    @ApiModelProperty(value = "密码",required = true,example = "123456")
    private String password;

    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为空字符串，也不能为null")
    //@NotBlank(message = "用户名不能为空白，不能为空字符串，不能为null")
    //@Size(min = 6, max = 12,message = "用户名必须在6-12位之间")
    @Pattern(regexp = "^[\u4e00-\u9fa5]{0,7}[a-zA-Z]{0,14}$",message = "用户名不能超过7个汉字或14个字符")
    @ApiModelProperty(value = "用户名",required = true,example = "Tony")
    private String username;

}
